/**
 * 休眠程序
 * @author wangsong
 * @param showMillisecond 休眠毫秒数
 * @date 2022/1/11 17:08
 * @return
 */
function sheep(showMillisecond) {
    // 执行时间
    return new Promise(resolve => {
        setTimeout(function () {
            resolve('resolved');
        }, showMillisecond);
    })
}


/**
 * 是否 pc打开
 * 返回true表示为pc端打开，返回false表示为手机端打开
 * @author wangsong
 * @param null
 * @date 2022/1/11 17:18
 * @return
 */
function isPc() {
    var userAgentInfo = navigator.userAgent;
    var Agents = new Array("Android", "iPhone", "SymbianOS", "Windows Phone", "iPad", "iPod");
    var flag = true;
    for (var v = 0; v < Agents.length; v++) {
        if (userAgentInfo.indexOf(Agents[v]) > 0) {
            flag = false;
            break;
        }
    }
    return flag;
}

/**
 * 获取url 参数
 * @author wangsong
 * @param name key
 * @date 2020/12/13 0013 0:59
 * @return
 * @version 1.0.1
 */
function getUrlParam(name) {
    let url = window.location.href
    let p = url.split('?')[1]
    let params = new URLSearchParams(p)
    return params.get(name);
}
